<html>
<head>
    <title>LoginActivity.java</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <style type="text/css">
        .ln { color: rgb(0,0,0); font-weight: normal; font-style: normal; }
        .s0 { color: rgb(0,0,128); font-weight: bold; }
        .s1 { }
        .s2 { color: rgb(128,128,128); font-style: italic; }
        .s3 { color: rgb(0,128,0); font-weight: bold; }
        .s4 { color: rgb(0,0,255); }
    </style>
</head>
<BODY BGCOLOR="#ffffff">
<TABLE CELLSPACING=0 CELLPADDING=5 COLS=1 WIDTH="100%" BGCOLOR="#C0C0C0">
    <TR>
        <TD>
            <CENTER>
                <FONT FACE="Arial, Helvetica" COLOR="#000000">
                    LoginActivity.java</FONT>
            </center>
        </TD>
    </TR>
</TABLE>
<pre>

<a name="l1"><span class="ln">1    </span></a><span class="s0">package </span><span class="s1">com.ibr.ticketmanagement.app; 
<a name="l2"><span class="ln">2    </span></a> 
<a name="l3"><span class="ln">3    </span></a></span><span class="s0">import </span><span
        class="s1">android.animation.Animator;
<a name="l4"><span class="ln">4    </span></a></span><span class="s0">import </span><span
        class="s1">android.animation.AnimatorListenerAdapter;
<a name="l5"><span class="ln">5    </span></a></span><span class="s0">import </span><span
        class="s1">android.annotation.TargetApi;
<a name="l6"><span class="ln">6    </span></a></span><span class="s0">import </span><span
        class="s1">android.app.Activity;
<a name="l7"><span class="ln">7    </span></a></span><span class="s0">import </span><span
        class="s1">android.os.AsyncTask;
<a name="l8"><span class="ln">8    </span></a></span><span class="s0">import </span><span
        class="s1">android.os.Build;
<a name="l9"><span class="ln">9    </span></a></span><span class="s0">import </span><span
        class="s1">android.os.Bundle;
<a name="l10"><span class="ln">10   </span></a></span><span class="s0">import </span><span
        class="s1">android.provider.ContactsContract;
<a name="l11"><span class="ln">11   </span></a></span><span class="s0">import </span><span
        class="s1">android.text.TextUtils;
<a name="l12"><span class="ln">12   </span></a></span><span class="s0">import </span><span
        class="s1">android.view.KeyEvent;
<a name="l13"><span class="ln">13   </span></a></span><span class="s0">import </span><span
        class="s1">android.view.View;
<a name="l14"><span class="ln">14   </span></a></span><span class="s0">import </span><span
        class="s1">android.view.View.OnClickListener;
<a name="l15"><span class="ln">15   </span></a></span><span class="s0">import </span><span
        class="s1">android.view.inputmethod.EditorInfo;
<a name="l16"><span class="ln">16   </span></a></span><span class="s0">import </span><span
        class="s1">android.widget.AutoCompleteTextView;
<a name="l17"><span class="ln">17   </span></a></span><span class="s0">import </span><span
        class="s1">android.widget.Button;
<a name="l18"><span class="ln">18   </span></a></span><span class="s0">import </span><span
        class="s1">android.widget.EditText;
<a name="l19"><span class="ln">19   </span></a></span><span class="s0">import </span><span
        class="s1">android.widget.TextView;
<a name="l20"><span class="ln">20   </span></a> 
<a name="l21"><span class="ln">21   </span></a></span><span class="s0">import <a
        href="../../../../com/ibr/ticketmanagement/app/util/Utilty.java.html">com.ibr.ticketmanagement.app.util.Utilty</a></span><span
        class="s1">;
<a name="l22"><span class="ln">22   </span></a> 
<a name="l23"><span class="ln">23   </span></a> 
<a name="l24"><span class="ln">24   </span></a></span><span class="s2">/** 
<a name="l25"><span class="ln">25   </span></a> * A login screen that offers login via email/password. 
<a name="l26"><span class="ln">26   </span></a> */</span><span class="s1"> 
<a name="l27"><span class="ln">27   </span></a></span><span class="s0">public class </span><span
        class="s1">LoginActivity </span><span class="s0">extends </span><span class="s1">Activity {
<a name="l28"><span class="ln">28   </span></a> 
<a name="l29"><span class="ln">29   </span></a>    </span><span class="s2">/** 
<a name="l30"><span class="ln">30   </span></a>     * Keep track of the login task to ensure we can cancel it if requested. 
<a name="l31"><span class="ln">31   </span></a>     */</span><span class="s1"> 
<a name="l32"><span class="ln">32   </span></a>    </span><span class="s0">private </span><span
        class="s1">UserLoginTask mAuthTask = </span><span class="s0">null</span><span class="s1">;
<a name="l33"><span class="ln">33   </span></a> 
<a name="l34"><span class="ln">34   </span></a>    </span><span
        class="s2">// UI references.</span><span class="s1">
<a name="l35"><span class="ln">35   </span></a>    </span><span class="s0">private </span><span
        class="s1">AutoCompleteTextView mEmailView;
<a name="l36"><span class="ln">36   </span></a>    </span><span class="s0">private </span><span
        class="s1">EditText mPasswordView;
<a name="l37"><span class="ln">37   </span></a>    </span><span class="s0">private </span><span
        class="s1">View mProgressView;
<a name="l38"><span class="ln">38   </span></a>    </span><span class="s0">private </span><span
        class="s1">View mLoginFormView;
<a name="l39"><span class="ln">39   </span></a> 
<a name="l40"><span class="ln">40   </span></a>    @Override 
<a name="l41"><span class="ln">41   </span></a>    </span><span
        class="s0">protected void </span><span class="s1">onCreate(Bundle savedInstanceState) {
<a name="l42"><span class="ln">42   </span></a>        </span><span class="s0">super</span><span
        class="s1">.onCreate(savedInstanceState);
<a name="l43"><span class="ln">43   </span></a>        setContentView(<a
            href="R.java.html">R.layout</a>.activity_login);
<a name="l44"><span class="ln">44   </span></a> 
<a name="l45"><span class="ln">45   </span></a>        </span><span class="s2">// Set up the login form.</span><span
        class="s1">
<a name="l46"><span class="ln">46   </span></a>        mEmailView = (AutoCompleteTextView) findViewById(<a
        href="R.java.html">R.id</a>.email);
<a name="l47"><span class="ln">47   </span></a> 
<a name="l48"><span class="ln">48   </span></a>        mPasswordView = (EditText) findViewById(<a
        href="R.java.html">R.id</a>.password);
<a name="l49"><span
        class="ln">49   </span></a>        mPasswordView.setOnEditorActionListener(</span><span
        class="s0">new </span><span class="s1">TextView.OnEditorActionListener() {
<a name="l50"><span class="ln">50   </span></a>            @Override 
<a name="l51"><span class="ln">51   </span></a>            </span><span
        class="s0">public boolean </span><span
        class="s1">onEditorAction(TextView textView, </span><span class="s0">int </span><span
        class="s1">id, KeyEvent keyEvent) {
<a name="l52"><span class="ln">52   </span></a>                </span><span
        class="s0">if </span><span class="s1">(id == <a href="R.java.html">R.id</a>.login || id == EditorInfo.IME_NULL) {
<a name="l53"><span class="ln">53   </span></a>                    attemptLogin(); 
<a name="l54"><span class="ln">54   </span></a>                    </span><span class="s0">return true</span><span
        class="s1">;
<a name="l55"><span class="ln">55   </span></a>                } 
<a name="l56"><span class="ln">56   </span></a>                </span><span
        class="s0">return false</span><span class="s1">;
<a name="l57"><span class="ln">57   </span></a>            } 
<a name="l58"><span class="ln">58   </span></a>        }); 
<a name="l59"><span class="ln">59   </span></a> 
<a name="l60"><span class="ln">60   </span></a>        Button mEmailSignInButton = (Button) findViewById(<a
            href="R.java.html">R.id</a>.email_sign_in_button);
<a name="l61"><span class="ln">61   </span></a>        mEmailSignInButton.setOnClickListener(</span><span
        class="s0">new </span><span class="s1">OnClickListener() {
<a name="l62"><span class="ln">62   </span></a>            @Override 
<a name="l63"><span class="ln">63   </span></a>            </span><span
        class="s0">public void </span><span class="s1">onClick(View view) {
<a name="l64"><span class="ln">64   </span></a>                attemptLogin(); 
<a name="l65"><span class="ln">65   </span></a>            } 
<a name="l66"><span class="ln">66   </span></a>        }); 
<a name="l67"><span class="ln">67   </span></a> 
<a name="l68"><span class="ln">68   </span></a>        mLoginFormView = findViewById(<a
            href="R.java.html">R.id</a>.login_form);
<a name="l69"><span class="ln">69   </span></a>        mProgressView = findViewById(<a
            href="R.java.html">R.id</a>.login_progress);
<a name="l70"><span class="ln">70   </span></a>    } 
<a name="l71"><span class="ln">71   </span></a> 
<a name="l72"><span class="ln">72   </span></a>    </span><span class="s2">/** 
<a name="l73"><span class="ln">73   </span></a>     * Attempts to sign in or register the account specified by the login form. 
<a name="l74"><span class="ln">74   </span></a>     * If there are form errors (invalid email, missing fields, etc.), the 
<a name="l75"><span class="ln">75   </span></a>     * errors are presented and no actual login attempt is made. 
<a name="l76"><span class="ln">76   </span></a>     */</span><span class="s1"> 
<a name="l77"><span class="ln">77   </span></a>    </span><span class="s0">public void </span><span
        class="s1">attemptLogin() {
<a name="l78"><span class="ln">78   </span></a>        </span><span class="s0">if </span><span
        class="s1">(mAuthTask != </span><span class="s0">null</span><span class="s1">) {
<a name="l79"><span class="ln">79   </span></a>            </span><span
        class="s0">return</span><span class="s1">;
<a name="l80"><span class="ln">80   </span></a>        } 
<a name="l81"><span class="ln">81   </span></a> 
<a name="l82"><span class="ln">82   </span></a>        </span><span
        class="s2">// Reset errors.</span><span class="s1">
<a name="l83"><span class="ln">83   </span></a>        mEmailView.setError(</span><span class="s0">null</span><span
        class="s1">);
<a name="l84"><span class="ln">84   </span></a>        mPasswordView.setError(</span><span
        class="s0">null</span><span class="s1">);
<a name="l85"><span class="ln">85   </span></a> 
<a name="l86"><span class="ln">86   </span></a>        </span><span class="s2">// Store values at the time of the login attempt.</span><span
        class="s1">
<a name="l87"><span class="ln">87   </span></a>        String email = mEmailView.getText().toString(); 
<a name="l88"><span class="ln">88   </span></a>        String password = mPasswordView.getText().toString(); 
<a name="l89"><span class="ln">89   </span></a> 
<a name="l90"><span class="ln">90   </span></a>        </span><span class="s0">boolean </span><span
        class="s1">cancel = </span><span class="s0">false</span><span class="s1">;
<a name="l91"><span class="ln">91   </span></a>        View focusView = </span><span
        class="s0">null</span><span class="s1">;
<a name="l92"><span class="ln">92   </span></a> 
<a name="l93"><span class="ln">93   </span></a> 
<a name="l94"><span class="ln">94   </span></a>        </span><span class="s2">// Check for a valid password, if the user entered one.</span><span
        class="s1">
<a name="l95"><span class="ln">95   </span></a>        </span><span class="s0">if </span><span
        class="s1">(!TextUtils.isEmpty(password) &amp;&amp; !isPasswordValid(password)) {
<a name="l96"><span class="ln">96   </span></a>            mPasswordView.setError(getString(<a
            href="R.java.html">R.string</a>.error_invalid_password));
<a name="l97"><span class="ln">97   </span></a>            focusView = mPasswordView; 
<a name="l98"><span class="ln">98   </span></a>            cancel = </span><span
        class="s0">true</span><span class="s1">;
<a name="l99"><span class="ln">99   </span></a>        } 
<a name="l100"><span class="ln">100  </span></a> 
<a name="l101"><span class="ln">101  </span></a>        </span><span class="s2">// Check for a valid email address.</span><span
        class="s1">
<a name="l102"><span class="ln">102  </span></a>        </span><span class="s0">if </span><span
        class="s1">(TextUtils.isEmpty(email)) {
<a name="l103"><span class="ln">103  </span></a>            mEmailView.setError(getString(<a
            href="R.java.html">R.string</a>.error_field_required));
<a name="l104"><span class="ln">104  </span></a>            focusView = mEmailView; 
<a name="l105"><span class="ln">105  </span></a>            cancel = </span><span
        class="s0">true</span><span class="s1">;
<a name="l106"><span class="ln">106  </span></a>        } </span><span
        class="s0">else if </span><span class="s1">(!isEmailValid(email)) {
<a name="l107"><span class="ln">107  </span></a>            mEmailView.setError(getString(<a
            href="R.java.html">R.string</a>.error_invalid_email));
<a name="l108"><span class="ln">108  </span></a>            focusView = mEmailView; 
<a name="l109"><span class="ln">109  </span></a>            cancel = </span><span
        class="s0">true</span><span class="s1">;
<a name="l110"><span class="ln">110  </span></a>        } 
<a name="l111"><span class="ln">111  </span></a> 
<a name="l112"><span class="ln">112  </span></a>        </span><span class="s0">if </span><span
        class="s1">(cancel) {
<a name="l113"><span class="ln">113  </span></a>            </span><span class="s2">// There was an error; don't attempt login and focus the first</span><span
        class="s1">
<a name="l114"><span class="ln">114  </span></a>            </span><span class="s2">// form field with an error.</span><span
        class="s1">
<a name="l115"><span class="ln">115  </span></a>            focusView.requestFocus(); 
<a name="l116"><span class="ln">116  </span></a>        } </span><span class="s0">else </span><span
        class="s1">{
<a name="l117"><span class="ln">117  </span></a>            </span><span class="s2">// Show a progress spinner, and kick off a background task to</span><span
        class="s1">
<a name="l118"><span class="ln">118  </span></a>            </span><span class="s2">// perform the user login attempt.</span><span
        class="s1">
<a name="l119"><span class="ln">119  </span></a>            showProgress(</span><span class="s0">true</span><span
        class="s1">);
<a name="l120"><span class="ln">120  </span></a>            mAuthTask = </span><span
        class="s0">new </span><span class="s1">UserLoginTask(email, password);
<a name="l121"><span class="ln">121  </span></a>            mAuthTask.execute((Void) </span><span
        class="s0">null</span><span class="s1">);
<a name="l122"><span class="ln">122  </span></a>        } 
<a name="l123"><span class="ln">123  </span></a>    } 
<a name="l124"><span class="ln">124  </span></a> 
<a name="l125"><span class="ln">125  </span></a>    </span><span
        class="s0">private boolean </span><span class="s1">isEmailValid(String email) {
<a name="l126"><span class="ln">126  </span></a>        </span><span class="s0">return </span><span
        class="s1">email.contains(</span><span class="s3">&quot;@&quot;</span><span class="s1">);
<a name="l127"><span class="ln">127  </span></a>    } 
<a name="l128"><span class="ln">128  </span></a> 
<a name="l129"><span class="ln">129  </span></a>    </span><span
        class="s0">private boolean </span><span class="s1">isPasswordValid(String password) {
<a name="l130"><span class="ln">130  </span></a>        </span><span class="s0">return </span><span
        class="s1">password.length() &gt; </span><span class="s4">1</span><span class="s1">;
<a name="l131"><span class="ln">131  </span></a>    } 
<a name="l132"><span class="ln">132  </span></a> 
<a name="l133"><span class="ln">133  </span></a>    </span><span class="s2">/** 
<a name="l134"><span class="ln">134  </span></a>     * Shows the progress UI and hides the login form. 
<a name="l135"><span class="ln">135  </span></a>     */</span><span class="s1"> 
<a name="l136"><span class="ln">136  </span></a>    @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2) 
<a name="l137"><span class="ln">137  </span></a>    </span><span class="s0">public void </span><span
        class="s1">showProgress(</span><span class="s0">final boolean </span><span class="s1">show) {
<a name="l138"><span class="ln">138  </span></a>        </span><span class="s2">// On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow</span><span
        class="s1">
<a name="l139"><span class="ln">139  </span></a>        </span><span class="s2">// for very easy animations. If available, use these APIs to fade-in</span><span
        class="s1">
<a name="l140"><span class="ln">140  </span></a>        </span><span class="s2">// the progress spinner.</span><span
        class="s1">
<a name="l141"><span class="ln">141  </span></a>        </span><span class="s0">if </span><span
        class="s1">(Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.HONEYCOMB_MR2) {
<a name="l142"><span class="ln">142  </span></a>            </span><span class="s0">int </span><span
        class="s1">shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);
<a name="l143"><span class="ln">143  </span></a> 
<a name="l144"><span class="ln">144  </span></a>            mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE); 
<a name="l145"><span class="ln">145  </span></a>            mLoginFormView.animate().setDuration(shortAnimTime).alpha( 
<a name="l146"><span class="ln">146  </span></a>                    show ? </span><span
        class="s4">0 </span><span class="s1">: </span><span class="s4">1</span><span class="s1">).setListener(</span><span
        class="s0">new </span><span class="s1">AnimatorListenerAdapter() {
<a name="l147"><span class="ln">147  </span></a>                @Override 
<a name="l148"><span class="ln">148  </span></a>                </span><span
        class="s0">public void </span><span class="s1">onAnimationEnd(Animator animation) {
<a name="l149"><span class="ln">149  </span></a>                    mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE); 
<a name="l150"><span class="ln">150  </span></a>                } 
<a name="l151"><span class="ln">151  </span></a>            }); 
<a name="l152"><span class="ln">152  </span></a> 
<a name="l153"><span class="ln">153  </span></a>            mProgressView.setVisibility(show ? View.VISIBLE : View.GONE); 
<a name="l154"><span class="ln">154  </span></a>            mProgressView.animate().setDuration(shortAnimTime).alpha( 
<a name="l155"><span class="ln">155  </span></a>                    show ? </span><span
        class="s4">1 </span><span class="s1">: </span><span class="s4">0</span><span class="s1">).setListener(</span><span
        class="s0">new </span><span class="s1">AnimatorListenerAdapter() {
<a name="l156"><span class="ln">156  </span></a>                @Override 
<a name="l157"><span class="ln">157  </span></a>                </span><span
        class="s0">public void </span><span class="s1">onAnimationEnd(Animator animation) {
<a name="l158"><span class="ln">158  </span></a>                    mProgressView.setVisibility(show ? View.VISIBLE : View.GONE); 
<a name="l159"><span class="ln">159  </span></a>                } 
<a name="l160"><span class="ln">160  </span></a>            }); 
<a name="l161"><span class="ln">161  </span></a>        } </span><span class="s0">else </span><span
        class="s1">{
<a name="l162"><span class="ln">162  </span></a>            </span><span class="s2">// The ViewPropertyAnimator APIs are not available, so simply show</span><span
        class="s1">
<a name="l163"><span class="ln">163  </span></a>            </span><span class="s2">// and hide the relevant UI components.</span><span
        class="s1">
<a name="l164"><span class="ln">164  </span></a>            mProgressView.setVisibility(show ? View.VISIBLE : View.GONE); 
<a name="l165"><span class="ln">165  </span></a>            mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE); 
<a name="l166"><span class="ln">166  </span></a>        } 
<a name="l167"><span class="ln">167  </span></a>    } 
<a name="l168"><span class="ln">168  </span></a> 
<a name="l169"><span class="ln">169  </span></a> 
<a name="l170"><span class="ln">170  </span></a>    </span><span
        class="s0">private interface </span><span class="s1">ProfileQuery {
<a name="l171"><span class="ln">171  </span></a>        String[] PROJECTION = { 
<a name="l172"><span class="ln">172  </span></a>                ContactsContract.CommonDataKinds.Email.ADDRESS, 
<a name="l173"><span class="ln">173  </span></a>                ContactsContract.CommonDataKinds.Email.IS_PRIMARY, 
<a name="l174"><span class="ln">174  </span></a>        }; 
<a name="l175"><span class="ln">175  </span></a> 
<a name="l176"><span class="ln">176  </span></a>        </span><span class="s0">int </span><span
        class="s1">ADDRESS = </span><span class="s4">0</span><span class="s1">;
<a name="l177"><span class="ln">177  </span></a>        </span><span class="s0">int </span><span
        class="s1">IS_PRIMARY = </span><span class="s4">1</span><span class="s1">;
<a name="l178"><span class="ln">178  </span></a>    } 
<a name="l179"><span class="ln">179  </span></a> 
<a name="l180"><span class="ln">180  </span></a>    </span><span class="s2">/** 
<a name="l181"><span class="ln">181  </span></a>     * Represents an asynchronous login/registration task used to authenticate 
<a name="l182"><span class="ln">182  </span></a>     * the user. 
<a name="l183"><span class="ln">183  </span></a>     */</span><span class="s1"> 
<a name="l184"><span class="ln">184  </span></a>    </span><span
        class="s0">public class </span><span class="s1">UserLoginTask </span><span class="s0">extends </span><span
        class="s1">AsyncTask&lt;Void, Void, Boolean&gt; {
<a name="l185"><span class="ln">185  </span></a> 
<a name="l186"><span class="ln">186  </span></a>        </span><span
        class="s0">private final </span><span class="s1">String mEmail;
<a name="l187"><span class="ln">187  </span></a>        </span><span
        class="s0">private final </span><span class="s1">String mPassword;
<a name="l188"><span class="ln">188  </span></a> 
<a name="l189"><span class="ln">189  </span></a>        UserLoginTask(String email, String password) { 
<a name="l190"><span class="ln">190  </span></a>            mEmail = email; 
<a name="l191"><span class="ln">191  </span></a>            mPassword = password; 
<a name="l192"><span class="ln">192  </span></a>        } 
<a name="l193"><span class="ln">193  </span></a> 
<a name="l194"><span class="ln">194  </span></a>        @Override 
<a name="l195"><span class="ln">195  </span></a>        </span><span
        class="s0">protected </span><span class="s1">Boolean doInBackground(Void... params) {
<a name="l196"><span class="ln">196  </span></a>            </span><span class="s2">// TODO: attempt authentication against a network service.</span><span
        class="s1">
<a name="l197"><span class="ln">197  </span></a> 
<a name="l198"><span class="ln">198  </span></a>            </span><span class="s0">try </span><span
        class="s1">{
<a name="l199"><span class="ln">199  </span></a>                </span><span class="s2">// Simulate network access.</span><span
        class="s1">
<a name="l200"><span class="ln">200  </span></a>                Thread.sleep(</span><span
        class="s4">2000</span><span class="s1">);
<a name="l201"><span class="ln">201  </span></a>            } </span><span
        class="s0">catch </span><span class="s1">(InterruptedException e) {
<a name="l202"><span class="ln">202  </span></a>                </span><span
        class="s0">return false</span><span class="s1">;
<a name="l203"><span class="ln">203  </span></a>            } 
<a name="l204"><span class="ln">204  </span></a> 
<a name="l205"><span class="ln">205  </span></a> 
<a name="l206"><span class="ln">206  </span></a>            </span><span class="s2">// TODO: Check the login via API, and do a get for the list of Action Plan.</span><span
        class="s1">
<a name="l207"><span class="ln">207  </span></a>            String token = </span><span class="s3">&quot;&quot;</span><span
        class="s1">;</span><span class="s2">// should come from the API</span><span class="s1">
<a name="l208"><span class="ln">208  </span></a>            <a
        href="../../../../com/ibr/ticketmanagement/app/util/Utilty.java.html">Utilty</a>.setLoginToken(getApplicationContext(), token);
<a name="l209"><span class="ln">209  </span></a> 
<a name="l210"><span class="ln">210  </span></a>            </span><span
        class="s0">return true</span><span class="s1">;
<a name="l211"><span class="ln">211  </span></a>        } 
<a name="l212"><span class="ln">212  </span></a> 
<a name="l213"><span class="ln">213  </span></a>        @Override 
<a name="l214"><span class="ln">214  </span></a>        </span><span
        class="s0">protected void </span><span class="s1">onPostExecute(</span><span class="s0">final </span><span
        class="s1">Boolean success) {
<a name="l215"><span class="ln">215  </span></a>            mAuthTask = </span><span
        class="s0">null</span><span class="s1">;
<a name="l216"><span class="ln">216  </span></a>            showProgress(</span><span class="s0">false</span><span
        class="s1">);
<a name="l217"><span class="ln">217  </span></a> 
<a name="l218"><span class="ln">218  </span></a>            </span><span class="s0">if </span><span
        class="s1">(success) {
<a name="l219"><span class="ln">219  </span></a>                finish(); 
<a name="l220"><span class="ln">220  </span></a>            } </span><span
        class="s0">else </span><span class="s1">{
<a name="l221"><span class="ln">221  </span></a>                mPasswordView.setError(getString(<a
            href="R.java.html">R.string</a>.error_incorrect_password));
<a name="l222"><span class="ln">222  </span></a>                mPasswordView.requestFocus(); 
<a name="l223"><span class="ln">223  </span></a>            } 
<a name="l224"><span class="ln">224  </span></a>        } 
<a name="l225"><span class="ln">225  </span></a> 
<a name="l226"><span class="ln">226  </span></a>        @Override 
<a name="l227"><span class="ln">227  </span></a>        </span><span
        class="s0">protected void </span><span class="s1">onCancelled() {
<a name="l228"><span class="ln">228  </span></a>            mAuthTask = </span><span
        class="s0">null</span><span class="s1">;
<a name="l229"><span class="ln">229  </span></a>            showProgress(</span><span class="s0">false</span><span
        class="s1">);
<a name="l230"><span class="ln">230  </span></a>        } 
<a name="l231"><span class="ln">231  </span></a>    } 
<a name="l232"><span class="ln">232  </span></a>} 
<a name="l233"><span class="ln">233  </span></a> 
<a name="l234"><span class="ln">234  </span></a> 
<a name="l235"><span class="ln">235  </span></a> 
<a name="l236"><span class="ln">236  </span></a></span></pre>
</body>
</html>